package com.controller;

import com.entity.PageBean;
import com.entity.PurOrder;
import com.entity.Result;
import com.service.PurOrderService;
import com.service.PurPayService;
import com.vo.PurOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/purpay")
public class PurPayController {
    @Autowired
    private PurPayService purPayService;

    @RequestMapping("/getPayList/{pageIndex}/{pageSize}")
    public Result getPayList(
          @PathVariable("pageIndex") Integer pageIndex,
          @PathVariable("pageSize") Integer pageSize,
          @RequestBody PurOrderVO purOrderVO
    ){
        PageBean<PurOrder> pageBean = purPayService.getPayList(pageIndex, pageSize, purOrderVO);
        return Result.ok(pageBean);
    }


    @PostMapping("/modifyPayList")
    public Result modifyPayList(@RequestBody PurOrder purOrder){
        purPayService.updatePayList(purOrder);
        return Result.ok();
    }


}
